const getTime = function(val) {
  const now =  new Date(val)
  const year = now.getFullYear();
  const month = now.getMonth()+1;
  const date = now.getDate();
  const hour = now.getHours();
  const minute = now.getMinutes();
  const second = now.getSeconds()
  return `${year}-${editTime(month)}-${editTime(date)} ${editTime(hour)}:${editTime(minute)}:${editTime(second)}`
}
const editTime = function(time){
  return time < 10? "0"+time : time
}

export default getTime